

\section{静磁场有限元分析}
\def\s3eq{静磁场有限元分析：}

\subsection{控制方程及边界条件}
静磁场的控制方程为：
\begin{equation}
    \begin{aligned}
        \nabla \times \boldsymbol{H} &= \boldsymbol{J} \\
        \nabla \cdot \boldsymbol{B} &= \boldsymbol{0}
    \end{aligned}
\end{equation}
由于$\nabla\cdot\boldsymbol{B}=0$，根据矢量恒等式，任意一个矢量函数的旋度的散度恒等于零，则引入矢量磁位函数$\boldsymbol{A}$：
\begin{equation}
    \begin{aligned}
        \boldsymbol{B}=\nabla\times\boldsymbol{A}
    \end{aligned}
\end{equation}
根据磁感应强度矢量与磁场强度矢量之间的关系$\boldsymbol{H}=\nu\boldsymbol{B}$，可得：
\begin{equation}
    \begin{aligned}
        \nabla\times\nu\nabla\times\boldsymbol{A}=\boldsymbol{J}
    \end{aligned}
\end{equation}
当场域中没有电流源时，上式可以写为：
\begin{equation}
    \begin{aligned}
        \nabla\times\nu\nabla\times\boldsymbol{A}=0
    \end{aligned}
\end{equation}
第一类边界条件：
\begin{equation}
    \boldsymbol{n}\times\boldsymbol{A}=\boldsymbol{n}\times\boldsymbol{A_{1}}
\end{equation}
第二类边界条件：
\begin{equation}
    \boldsymbol{n}\times\nu\nabla\times\boldsymbol{A}=\boldsymbol{n}\times\boldsymbol{H_{2}}
\end{equation}
第三类边界条件：
\begin{equation}
    \boldsymbol{n}\times\nu\nabla\times\boldsymbol{A}+\gamma\boldsymbol{A}=\boldsymbol{n}\times\boldsymbol{H_{3}}
\end{equation}



\subsection{有限元方程}
\subsubsection{里兹法}
静磁场对应的算子为：
\begin{equation}
    \mathcal{L}=\nabla\times\nu\nabla\times
\end{equation}
则静磁场控制泛函可以写为：
\begin{equation}
    \begin{aligned}
        \mathcal{F}&=(\boldsymbol{A})=\frac{1}{2}<\mathcal{L}\boldsymbol{A},\boldsymbol{A}>-<\boldsymbol{A},\boldsymbol{J}>  \\
                   &=\frac{1}{2}\int_{V}\nabla\times\nu\nabla\times\boldsymbol{A}\cdot\boldsymbol{A}\mathrm{d}V-\int_{V}\boldsymbol{A}\cdot\boldsymbol{J}\mathrm{d}V
    \end{aligned}
\end{equation}
由矢量格林定理，有：
\begin{equation}
    \frac{1}{2}\int_{V}\nabla\times\nu\nabla\times\boldsymbol{A}\cdot\boldsymbol{A}\mathrm{d}V=
    \frac{1}{2}\int_{V}\nu\left(\nabla\times\boldsymbol{A}\right)\cdot\left(\nabla\times\boldsymbol{A}\right)\mathrm{d}V
    -\frac{1}{2}\int_{S}\nu\left(\boldsymbol{A}\times\nabla\times\boldsymbol{A}\right)\cdot\boldsymbol{n}\mathrm{d}S
\end{equation}
因此，对应泛函可以写为：
\begin{equation}
    \mathcal{F}(\boldsymbol{A})=\frac{1}{2}\int_{V}\nu\left(\nabla\times\boldsymbol{A}\right)\cdot\left(\nabla\times\boldsymbol{A}\right)\mathrm{d}V
    -\int_{V}\boldsymbol{A}\cdot\boldsymbol{J}\mathrm{d}V
    -\frac{1}{2}\int_{S}\nu\left(\boldsymbol{A}\times\nabla\times\boldsymbol{A}\right)\cdot\boldsymbol{n}\mathrm{d}S
\end{equation}
将第三类边界条件带入，有：
\begin{equation}
    \int_{S}\nu\left(\boldsymbol{A}\times\nabla\times\boldsymbol{A}\right)\cdot\boldsymbol{n}\mathrm{d}S \rightarrow
    \int_{S_{3}}\left(\gamma\boldsymbol{A}-\boldsymbol{n}\times\boldsymbol{H}_{3}\right)\cdot\boldsymbol{n}\mathrm{d}S
\end{equation}
因此，上述泛函可以进一步表示为：
\begin{equation}
    \mathcal{F}(\boldsymbol{A})=\frac{1}{2}\int_{V}\nu\left(\nabla\times\boldsymbol{A}\right)\cdot\left(\nabla\times\boldsymbol{A}\right)\mathrm{d}V
    -\int_{V}\boldsymbol{A}\cdot\boldsymbol{J}\mathrm{d}V
    -\frac{1}{2}\int_{S_{3}}\left(\gamma\boldsymbol{A}-\boldsymbol{n}\times\boldsymbol{H}_{3}\right)\cdot\boldsymbol{n}\mathrm{d}S
\end{equation}
\subsubsection{二维情况}
首先不考虑第三类非齐次边界条件，因此，泛函在二维情况下可以写为：
\begin{equation}
    \mathcal{F}(A_{z})=\frac{1}{2}\int_{S}\nu\left[\left(\frac{\partial A_{z}}{\partial x}\right)^{2}+\left(\frac{\partial A_{z}}{\partial y}\right)^{2}\right]\mathrm{d}S
    -\int_{\Gamma}A_{z}J_{z}\mathrm{d}\Gamma
\end{equation}
对于二维三角形单元：
\begin{equation}
    \mathcal{F}(A_{z})=\sum_{e=1}^{M}\mathcal{F}^{e}(A_{z}^{e})
\end{equation}
其中：
\begin{equation}
    \mathcal{F}^{e}(A_{z}^{e})=\frac{1}{2}\int_{S}\nu\left[\left(\frac{\partial A_{z}^{e}}{\partial x}\right)^{2}+\left(\frac{\partial A_{z}^{e}}{\partial y}\right)^{2}\right]\mathrm{d}S
    -\int_{\Gamma}A_{z}^{e}J_{z}^{e}\mathrm{d}\Gamma
\end{equation}
插值函数可以写为：
\begin{equation}
    A_{z}^{e} = \sum_{i=1}^{3}N_{i}^{e}A_{z,i}^{e}
\end{equation}
零上述单元泛函对$A_{z,i}^{e}$求导可以得到：
\begin{equation}
    \frac{\partial \mathcal{F}^{e}(A_{z}^{e})}{\partial A_{z,i}^{e}}=
    \int_{S}\nu\left( \frac{\partial N_{i}^{e}}{\partial x}\frac{\partial N_{j}^{e}}{\partial x} + \frac{\partial N_{i}^{e}}{\partial y}\frac{\partial N_{j}^{e}}{\partial y} \right)A_{z,i}^{e}\mathrm{d}S
    -\int_{\Gamma}N_{i}^{e}J_{z}^{e}\mathrm{d}\Gamma
\end{equation}
进一步整理为矩阵形式：
\begin{equation}
    \left\{ \frac{\partial \mathcal{F}^{e}(A_{z}^{e})}{\partial A_{z}^{e}} \right\}=
    \left[ K^{e} \right]\left\{ A_{z}^{e} \right\}-\left\{ b^{e} \right\}
\end{equation}
强加驻点条件，令上式等于零，有：
\begin{equation}
    \left[K^{e}\right]\left\{A_{z}^{e}\right\}=\left\{b^{e}\right\}
\end{equation}
式中：
\begin{equation}
    \begin{aligned}
        K_{ij}^{e}&=\int_{S}\nu\left(\frac{\partial N_{i}^{e}}{\partial x}\frac{\partial N_{j}^{e}}{\partial x} + \frac{\partial N_{i}^{e}}{\partial y}\frac{\partial N_{j}^{e}}{\partial y}\right)\mathrm{d}S  \\
        b_{i}^{e}&=\int_{\Gamma}N_{i}^{e}J_{z}^{e}\mathrm{d}\Gamma
    \end{aligned}
\end{equation}
一般情况下，磁阻率$\nu$与电流密度$J^{e}$在单元$e$内被认为是不变的，因此可以得到上述表达式的解析表达式：
\begin{equation}
    \begin{aligned}
        K_{ij}^{e}&=\frac{1}{4\Delta^{e}}\nu\left(b_{i}^{e}b_{j}^{e}+c_{i}^{e}c_{j}^{e}\right)  \\
        b_{i}^{e}&=\frac{\Delta^{e}}{3}J_{z}^{e}
    \end{aligned}
\end{equation}
得到了单元方程，利用单元的全局坐标，可以得到全局方程：
\begin{equation}
    \left[K\right]\left\{A_{z}\right\}=\left\{b\right\}
\end{equation}


\subsubsection{三维情况}
首先不考虑第三类非齐次边界条件，因此，泛函在三维情况下可以写为：
\begin{equation}
    \begin{aligned}
        \mathcal{F}(\boldsymbol{A})=&\frac{1}{2}\int_{V}\nu\left[\left(\frac{\partial A_{z}}{\partial y}-\frac{\partial A_{y}}{\partial z}\right)^{2}
        +\left(\frac{\partial A_{x}}{\partial z}-\frac{\partial A_{z}}{\partial x}\right)^{2}
        +\left(\frac{\partial A_{y}}{\partial x}-\frac{\partial A_{x}}{\partial y}\right)^{2}\right]\mathrm{d}V  \\
        &-\int_{V}\left(A_{x}J_{x}+A_{y}J_{y}+A_{z}J_{z}\right)\mathrm{d}V
    \end{aligned}
\end{equation}
将求解区域划分为$M$个单元，则整体泛函可以表示为所有单元$e$的泛函求和：
\begin{equation}
    \mathcal{F}(\boldsymbol{A})=\sum_{e=1}^{M}\mathcal{F}^{e}(\boldsymbol{A})
\end{equation}
其中：
\begin{equation}
    \begin{aligned}
        \mathcal{F}^{e}(\boldsymbol{A}^{e})=&\frac{1}{2}\int_{V}\nu\left[\left(\frac{\partial A_{z}^{e}}{\partial y}-\frac{\partial A_{y}^{e}}{\partial z}\right)^{2}
        +\left(\frac{\partial A_{x}^{e}}{\partial z}-\frac{\partial A_{z}^{e}}{\partial x}\right)^{2}
        +\left(\frac{\partial A_{y}^{e}}{\partial x}-\frac{\partial A_{x}^{e}}{\partial y}\right)^{2}\right]\mathrm{d}V  \\
        &-\int_{V}\left(A_{x}^{e}J_{x}^{e}+A_{y}^{e}J_{y}^{e}+A_{z}^{e}J_{z}^{e}\right)\mathrm{d}V
    \end{aligned}
\end{equation}
对于三维四面体单元：插值函数可以写为：
\begin{equation}
    \begin{aligned}
        A_{x}^{e} &= \sum_{i=1}^{4}N_{i}^{e}A_{x,i}^{e}  \\
        A_{y}^{e} &= \sum_{i=1}^{4}N_{i}^{e}A_{y,i}^{e}  \\
        A_{z}^{e} &= \sum_{i=1}^{4}N_{i}^{e}A_{z,i}^{e} 
    \end{aligned}
\end{equation}
零上述单元泛函对$A_{x,i}^{e}$求导可以得到：
\begin{equation}
    \begin{aligned}
        \frac{\partial \mathcal{F}^{e}(A^{e})}{\partial A_{x,i}^{e}}=&
        \int_{V}\nu\left( \frac{\partial N_{i}^{e}}{\partial z}\frac{\partial N_{j}^{e}}{\partial z} + \frac{\partial N_{i}^{e}}{\partial y}\frac{\partial N_{j}^{e}}{\partial y} \right)A_{x,j}^{e}\mathrm{d}V  \\
        &-\int_{V}\nu\left( \frac{\partial N_{i}^{e}}{\partial z}\frac{\partial N_{j}^{e}}{\partial x} \right)A_{z,j}^{e}\mathrm{d}V
        -\int_{V}\nu\left( \frac{\partial N_{i}^{e}}{\partial z}\frac{\partial N_{j}^{e}}{\partial x} \right)A_{y,j}^{e}\mathrm{d}V
        -\int_{S}N_{i}^{e}J_{x}^{e}\mathrm{d}S
    \end{aligned}
\end{equation}
进一步整理为矩阵形式：
\begin{equation}
    \begin{aligned}
        \left\{ \frac{\partial \mathcal{F}^{e}(A^{e})}{\partial A_{x}^{e}} \right\}=
        \left[ K^{e}_{xx} \right]\left\{ A_{x}^{e} \right\}+\left[ K^{e}_{xy} \right]\left\{ A_{y}^{e} \right\}+\left[ K^{e}_{xz} \right]\left\{ A_{z}^{e} \right\}
        -\left\{ b^{e}_{x} \right\}
    \end{aligned}
\end{equation}
式中：
\begin{eqnarray}
    \begin{aligned}
        K^{e}_{xx,ij}&=\int_{V}\nu\left( \frac{\partial N_{i}^{e}}{\partial z}\frac{\partial N_{j}^{e}}{\partial z} + \frac{\partial N_{i}^{e}}{\partial y}\frac{\partial N_{j}^{e}}{\partial y} \right)\mathrm{d}V  \\
        K^{e}_{xy,ij}&=-\int_{V}\nu\left( \frac{\partial N_{i}^{e}}{\partial z}\frac{\partial N_{j}^{e}}{\partial x} \right)\mathrm{d}V  \\
        K^{e}_{xz,ij}&=-\int_{V}\nu\left( \frac{\partial N_{i}^{e}}{\partial z}\frac{\partial N_{j}^{e}}{\partial x} \right)\mathrm{d}V  \\
        b^{e}_{x,i}&=\int_{\Gamma}N_{i}^{e}J_{x}^{e}\mathrm{d}\Gamma
    \end{aligned}
\end{eqnarray}
一般情况下，磁阻率$\nu$与电流密度$J^{e}$在单元$e$内被认为是不变的，因此可以得到上述表达式的解析表达式：
\begin{equation}
    \begin{aligned}
        K_{xx,ij}^{e}&=\frac{\nu}{36 V^{e}}\nu\left(d_{i}^{e}d_{j}^{e}+c_{i}^{e}c_{j}^{e}\right)  \\
        K_{xy,ij}^{e}&=-\frac{\nu}{36 V^{e}}\nu\left(d_{i}^{e}b_{j}^{e}\right)  \\
        K_{xz,ij}^{e}&=-\frac{\nu}{36 V^{e}}\nu\left(d_{i}^{e}b_{j}^{e}\right)  \\
        b_{x,i}^{e}&=\frac{V^{e}}{4}J_{x}^{e}
    \end{aligned}
\end{equation}
强加驻点条件，令上式等于零，有：
\begin{equation}
    \left[ K^{e}_{xx} \right]\left\{ A_{x}^{e} \right\}+\left[ K^{e}_{xy} \right]\left\{ A_{y}^{e} \right\}+\left[ K^{e}_{xz} \right]\left\{ A_{z}^{e} \right\}
    =\left\{ b^{e}_{x} \right\}
\end{equation}
同样，零上述单元泛函对$A_{y,i}^{e}$、$A_{z,i}^{e}$求导，并强加驻点条件，结合上式最终得到：
\begin{equation}
    \begin{aligned}
        \left[ K^{e}_{xx} \right]\left\{ A_{x}^{e} \right\}+\left[ K^{e}_{xy} \right]\left\{ A_{y}^{e} \right\}+\left[ K^{e}_{xz} \right]\left\{ A_{z}^{e} \right\}
        &=\left\{ b^{e}_{x} \right\}   \\
        \left[ K^{e}_{yx} \right]\left\{ A_{x}^{e} \right\}+\left[ K^{e}_{yy} \right]\left\{ A_{y}^{e} \right\}+\left[ K^{e}_{yz} \right]\left\{ A_{z}^{e} \right\}
        &=\left\{ b^{e}_{y} \right\}   \\
        \left[ K^{e}_{zx} \right]\left\{ A_{x}^{e} \right\}+\left[ K^{e}_{zy} \right]\left\{ A_{y}^{e} \right\}+\left[ K^{e}_{zz} \right]\left\{ A_{z}^{e} \right\}
        &=\left\{ b^{e}_{z} \right\}
    \end{aligned}
\end{equation}
将结点局部编号对应到其全局编号，进一步整理为：
\begin{equation}
    \left[
        \begin{aligned}
            K_{xx} && K_{xy} && K_{xz} \\
            K_{yx} && K_{yy} && K_{yz} \\
            K_{zx} && K_{zy} && K_{zz}  
        \end{aligned}
    \right]\left\{
        \begin{aligned}
            A_{x} \\ A_{y} \\ A_{z}
        \end{aligned}
    \right\}=\left\{
        \begin{aligned}
            b_{x} \\ b_{y} \\ b_{z}
        \end{aligned}
    \right\}
\end{equation}



\subsubsection{伽辽金法等效性}

\subsection{工程常用边界条件}

\subsection{非线性磁阻率}



